<template>
  <div id="main">
      <h1>
        {{blogtitle}}
      </h1>
      <div v-html="blogbody">
      </div>
      
      <hr>
      <Commit></Commit>

  </div>
</template>

<script>
import marked from "marked";
import Commit from "./commit";
export default {
  data() {
    return {
      blogbody: "",
      blogtitle:""
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    init: function() {
      var that = this;
      this.$http({
        method: "get",
        baseURL: this.blogurl,
        url:
          "https://api.github.com/repos/FireUnicornser/govBlog/issues/" +
          that.$route.params.id
      }).then(function(response) {
        that.blogbody = marked(response.data["body"]);
        that.blogtitle = response.data["title"];
      });
    }
  },
  components: {
    Commit
  }
};
</script>

<style>

</style>
